Tail all elimination on the Java

نویسنده

  • Martin Odersky
چکیده

URL: http://www.elsevier.nl/locate/entcs/volume59.html 14 pages Tail all elimination on the Java Virtual Ma hine Mi hel S hinz 1 Martin Odersky 2 É ole Polyte hnique Fédérale de Lausanne Abstra t A problem that often has to be solved by ompilers for fun tional languages targeting the Java Virtual Ma hine is the elimination of tail alls. This paper explains how we solved it in our Funnel ompiler and presents some experimental results about the impa t our te hnique has on both performan e and size of the ompiled programs. 1 Introdu tion A problem fa ed by authors of ompilers for fun tional languages targeting the Java Virtual Ma hine (JVM) [7℄ is the elimination of tail alls. Fun tional programming languages typi ally do not have expli it looping onstru ts, and programmers therefore have to resort to re ursion to perform loops. While this is no major problem for programmers, ompiler writers have to make sure that their implementations perform tail all elimination, an optimisation whi h guarantees that loops implemented using re ursion exe ute in onstant spa e. Implementing tail all elimination in its full generality typi ally requires some support from the target ma hine. Unfortunately, the JVM does not provide su h support, and implementors either have to abandon general tail all elimination, or use spe ial tri ks. We have implemented general tail all elimination for our Funnel ompiler. This paper explains the te hnique we used, and shows its impa t on ode size and exe ution time for several ben hmark programs. It is stru tured in the following way: Se tion 2 explains why tail all elimination is needed, espeially in the urrent version of Funnel; Se tion 3 presents known te hniques to eliminate tail alls, then our te hnique and some experimental results about it; Se tion 4 presents related work; nally, Se tion 5 on ludes and talks about future work.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Tail call elimination on the Java Virtual Machine

A problem that often has to be solved by compilers for functional languages targeting the Java Virtual Machine is the elimination of tail calls. This paper explains how we solved it in our Funnel compiler and presents some experimental results about the impact our technique has on both performance and size of the compiled programs.

متن کامل

Program transformations in weak memory models

We analyse the validity of common optimisations on multi-threaded programs in two memory models—the DRF guarantee and the Java Memory Model. Unlike in the single-threaded world, even simple program transformations, such as common subexpression elimination, can introduce new behaviours in shared-memory multi-threading with an interleaved semantics. To validate such optimisations, most current pr...

متن کامل

Memory-Efficient Tail Calls in the JVM with Imperative Functional Objects

This paper presents FCore: a JVM implementation of System F with support for full tail-call elimination (TCE). Our compilation technique for FCore is innovative in two respects: it uses a new representation for first-class functions called imperative functional objects; and it provides a way to do TCE on the JVM using constant space. Unlike conventional TCE techniques on the JVM, allocated func...

متن کامل

Stack-Based Typed Assembly Language

In previous work, we presented a Typed Assembly Language (TAL). TAL is sufficiently expressive to serve as a target language for compilers of high-level languages such as ML. This work assumed such a compiler would perform a continuation-passing style transform and eliminate the control stack by heap-allocating activation records. However, most compilers are based on stack allocation. This pape...

متن کامل

Compile Time Elimination of Null- and Bounds-Checks

SafeTSA is a new type safe intermediate representation for mobile code based on static single assignment form. We developed SafeTSA as an alternative to the Java Virtual Machine. Programs in SafeTSA contain explicit nulland bounds-check instructions, allowing their elimination. Type safety is maintained by enforcing the use of only nulland bounds-checked values in dereference and index operatio...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2001